class Solution:
    def mostCommonWord(self, paragraph: str, banned: List[str]) -> str:
        marks = "!?',;."
        for mark in marks:
            paragraph = paragraph.replace(mark, ' ')
        words = paragraph.split()
        banned = set(banned)
        wordFreq = {}
        for word in words:
            word = word.lower()
            if word not in banned:
                wordFreq[word] = wordFreq.get(word, 0) + 1
        maxFreq = 0
        maxFreqWord = ''
        for word, freq in wordFreq.items():
            if freq > maxFreq:
                maxFreq = freq
                maxFreqWord = word
        return maxFreqWord
